home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Information / Digests / CSMP Digest / volume 3 / csmp-digest-v3-063 / doubleCR.1 < prev   
Encoding:
Text File  |  1995-12-31  |  84.1 KB  |  2,142 lines

  1. C.S.M.P. Digest             Thu, 06 Oct 94       Volume 3 : Issue 63
  2.  
  3. Today's Topics:
  4.  
  5.         <command>+? == PLAIN STUPID!!! (true)
  6.         Apple Events Question
  7.         File System Manager Software Development Kit
  8.         GDGX Graphics Shell bus errors with GX Beta 3...
  9.         Getting Started (Summary)
  10.         Help: idle, shutdown, and MacTCP examples..
  11.         Pascal Flavours for Macintosh
  12.         Q: Script-Independant Command-Keys?
  13.         XCMD memory residence
  14.  
  15.  
  16.  
  17. The Comp.Sys.Mac.Programmer Digest is moderated by Francois Pottier
  18. (pottier@clipper.ens.fr).
  19.  
  20. The digest is a collection of article threads from the internet newsgroup
  21. comp.sys.mac.programmer.  It is designed for people who read c.s.m.p. semi-
  22. regularly and want an archive of the discussions.  If you don't know what a
  23. newsgroup is, you probably don't have access to it.  Ask your systems
  24. administrator(s) for details.  If you don't have access to news, you may
  25. still be able to post messages to the group by using a mail server like
  26. anon.penet.fi (mail help@anon.penet.fi for more information).
  27.  
  28. Each issue of the digest contains one or more sets of articles (called
  29. threads), with each set corresponding to a 'discussion' of a particular
  30. subject.  The articles are not edited; all articles included in this digest
  31. are in their original posted form (as received by our news server at
  32. nef.ens.fr).  Article threads are not added to the digest until the last
  33. article added to the thread is at least two weeks old (this is to ensure that
  34. the thread is dead before adding it to the digest).  Article threads that
  35. consist of only one message are generally not included in the digest.
  36.  
  37. The digest is officially distributed by two means, by email and ftp.
  38.  
  39. If you want to receive the digest by mail, send email to listserv@ens.fr
  40. with no subject and one of the following commands as body:
  41.     help                        Sends you a summary of commands
  42.     subscribe csmp-digest Your Name    Adds you to the mailing list
  43.     signoff csmp-digest            Removes you from the list
  44. Once you have subscribed, you will automatically receive each new
  45. issue as it is created.
  46.  
  47. The official ftp info is //ftp.dartmouth.edu/pub/csmp-digest.
  48. Questions related to the ftp site should be directed to
  49. scott.silver@dartmouth.edu. Currently no previous volumes of the CSMP
  50. digest are available there.
  51.  
  52. Also, the digests are available to WAIS users.  To search back issues
  53. with WAIS, use comp.sys.mac.programmer.src. With Mosaic, use
  54. http://www.wais.com/wais-dbs/comp.sys.mac.programmer.html.
  55.  
  56.  
  57. -------------------------------------------------------
  58.  
  59. >From alun@isy.liu.se (Anders Lundqvist)
  60. Subject: <command>+? == PLAIN STUPID!!! (true)
  61. Date: 19 Sep 1994 06:42:44 GMT
  62. Organization: Dept. of E.E., Univ. of Linkoping
  63.  
  64. Greetings all programmers!
  65.  
  66. I wonder how many of you that implement keyboard shortcuts 
  67. like <command>+? realize that these DO NOT work on many 
  68. international keyboard layouts like the swedish????
  69.  
  70. Why? Because in order to produce a question mark I need to 
  71. use the shift key and since the command key disables the shift
  72. key, this doesn't work. I have been playing around with the DA
  73. Keyboard and there's simply no way around. Obiwan uses <command>+`
  74. and this I can emulate by pressing <command>+<option>+<control>+'.
  75. Sigh...
  76.  
  77. Of course, this wouldn't been so bad if there was an equivalent 
  78. meny command, but in many cases there isn't. Usually <command>+?
  79. invokes some help mode and turns the pointer into a question mark
  80. to allow the user to point at an object (e.g Disinfectant and 
  81. Mathematica). 
  82.  
  83. IS THIS PROBLEM MENTIONED IN THE HUMAN INTERFACE GUIDELINES???
  84.  
  85.  
  86. Thank you for any feedback!
  87.  
  88. Anders Lundqvist
  89. Department of EE
  90. Linkoping University
  91. Sweden
  92.   
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100. +++++++++++++++++++++++++++
  101.  
  102. >From philip@cs.wits.ac.za (Philip Machanick)
  103. Date: 19 Sep 1994 08:16:47 GMT
  104. Organization: Computer Science Dept, U of Witwatersrand
  105.  
  106. In article <35jbt4$mac@newsy.ifm.liu.se>, alun@isy.liu.se wrote:
  107.  
  108. > Why? Because in order to produce a question mark I need to 
  109. > use the shift key and since the command key disables the shift
  110. > key, this doesn't work.
  111.  
  112. This is also true on the English and US keyboards: "?" is shift-/. Where
  113. did you get the idea that command disables shift? All the modifiers are
  114. independent and can be sensed independently. If COMMAND-? is not working
  115. for you there must be some other explanation.
  116. -- 
  117. Philip Machanick                   philip@cs.wits.ac.za
  118. Department of Computer Science, University of the Witwatersrand
  119. 2050 Wits, South Africa        (at University of Cape Town 4 July-7 Nov)
  120. phone 27(11)716-3309  fax 27(11)339-7965
  121.  
  122. +++++++++++++++++++++++++++
  123.  
  124. >From resnick@uiuc.edu (Pete Resnick)
  125. Date: Mon, 19 Sep 1994 08:35:23 -0500
  126. Organization: University of Illinois at Urbana-Champaign
  127.  
  128. In article <philip-1909941017020001@mackerel.cs.uct.ac.za>,
  129. philip@cs.wits.ac.za (Philip Machanick) wrote:
  130.  
  131. > In article <35jbt4$mac@newsy.ifm.liu.se>, alun@isy.liu.se wrote:
  132. > > Why? Because in order to produce a question mark I need to 
  133. > > use the shift key and since the command key disables the shift
  134. > > key, this doesn't work.
  135. > This is also true on the English and US keyboards: "?" is shift-/. Where
  136. > did you get the idea that command disables shift? All the modifiers are
  137. > independent and can be sensed independently. If COMMAND-? is not working
  138. > for you there must be some other explanation.
  139.  
  140. You're wrong Phil. Command does in fact disable the shift modifier. See
  141. the tech note on International Cancelling. To properly handle the command
  142. key in your application, you should always strip the command-key bit out
  143. of the modifiers field and re-pass the keystroke through KeyTrans. Here's
  144. some source code for doing it with the cancel key, but you should use
  145. similar code for any command-key combination (like in MenuKey):
  146.  
  147. /* These both use Universal Headers. The second is for System 6 too. */
  148.  
  149. Boolean WasCancel(EventRecord *theEvent)
  150. {
  151.     short keyCode;
  152.     long state = 0L, test;
  153.     unsigned long keys;
  154.     
  155.     if(!(theEvent->modifiers & cmdKey))
  156.         return(false);
  157.     keyCode = (theEvent->modifiers & 0xFE00) |
  158.               ((theEvent->message & keyCodeMask) >> 8);
  159.     keys = KeyTranslate((Ptr)GetScriptManagerVariable(smKCHRCache),
  160.                         keyCode, &state);
  161.     return(((Byte)keys == '.') || ((Byte)(keys >>= 16) == '.'));
  162. }
  163.  
  164. Boolean WasCancelSystem6or7(EventRecord *theEvent)
  165. {
  166.     short keyCode, rsrcID, scriptID;
  167.     Ptr kchrPtr;
  168.     Handle kchrRsrc = nil;
  169.     long state = 0L;
  170.     unsigned long keys;
  171.     
  172.     if(!(theEvent->modifiers & cmdKey))
  173.         return(false);
  174.     keyCode = (theEvent->modifiers & 0xFE00) |
  175.               ((theEvent->message & keyCodeMask) >> 8);
  176.     if((kchrPtr = (Ptr)GetScriptManagerVariable(smKCHRCache)) == nil) {
  177.         scriptID = GetScriptManagerVariable(smKeyScript);
  178.         rsrcID = GetScriptVariable(scriptID, smScriptKeys);
  179.         kchrRsrc = GetResource('KCHR', rsrcID);
  180.         if(kchrRsrc != nil)
  181.             kchrPtr = *kchrRsrc;
  182.     }
  183.     if(kchrPtr != nil)
  184.         keys = KeyTranslate(kchrPtr, keyCode, &state);
  185.     if(kchrRsrc != nil)
  186.         ReleaseResource(kchrRsrc);
  187.     return(((Byte)keys == '.') || ((Byte)(keys >>= 16) == '.'));
  188. }
  189. -- 
  190. Pete Resnick    (...so what is a mojo, and why would one be rising?)
  191. Doctoral Student - Philosophy Department, Gregory Hall, UIUC
  192. System manager - Cognitive Science Group, Beckman Institute, UIUC
  193. Internet: resnick@uiuc.edu
  194.  
  195. +++++++++++++++++++++++++++
  196.  
  197. >From alun@isy.liu.se (Anders Lundqvist)
  198. Date: 19 Sep 1994 13:31:07 GMT
  199. Organization: Dept. of E.E., Univ. of Linkoping
  200.  
  201. In article 1909941017020001@mackerel.cs.uct.ac.za, philip@cs.wits.ac.za (Philip Machanick) writes:
  202. >In article <35jbt4$mac@newsy.ifm.liu.se>, alun@isy.liu.se wrote:
  203. >
  204. >> Why? Because in order to produce a question mark I need to 
  205. >> use the shift key and since the command key disables the shift
  206. >> key, this doesn't work.
  207. >
  208. >This is also true on the English and US keyboards: "?" is shift-/. Where
  209. >did you get the idea that command disables shift? All the modifiers are
  210. >independent and can be sensed independently. If COMMAND-? is not working
  211. >for you there must be some other explanation.
  212. >-- 
  213. >Philip Machanick                   philip@cs.wits.ac.za
  214. >Department of Computer Science, University of the Witwatersrand
  215. >2050 Wits, South Africa        (at University of Cape Town 4 July-7 Nov)
  216. >phone 27(11)716-3309  fax 27(11)339-7965
  217.  
  218. I'll try again...
  219.  
  220. On my keybord the "?" is located next to the "0" (zero) key and is 
  221. <shift>+"+". If I use the DA Keyboard and press the shift key then all
  222. letters turn into capital letters and the "+" sign turns into a question 
  223. mark. OK! If I now keep the shift key pressed and press the <command> key
  224. all letter go back to normal and the "?" is transmogrified into a "+" again.
  225.  
  226. Does this happen to you? If it does and you can use <command>+"?" then I'm 
  227. completely lost...
  228.  
  229. Of course, everything works as a charm if I turn on the US keyboard layout.
  230.  
  231.  
  232. Anders Lundqvist
  233. Department of EE
  234. Linkoping University
  235. Sweden
  236.  
  237.  
  238.  
  239. +++++++++++++++++++++++++++
  240.  
  241. >From pcastine@prz.tu-berlin.de (Peter Castine)
  242. Date: Mon, 19 Sep 1994 15:19:45 GMT
  243. Organization: Process Control Center
  244.  
  245. In article <philip-1909941017020001@mackerel.cs.uct.ac.za>,
  246. philip@cs.wits.ac.za (Philip Machanick) wrote:
  247.  
  248. > In article <35jbt4$mac@newsy.ifm.liu.se>, alun@isy.liu.se wrote:
  249. > > Why? Because in order to produce a question mark I need to 
  250. > > use the shift key and since the command key disables the shift
  251. > > key, this doesn't work.
  252. > This is also true on the English and US keyboards: "?" is shift-/. Where
  253. > did you get the idea that command disables shift? All the modifiers are
  254. > independent and can be sensed independently. If COMMAND-? is not working
  255. > for you there must be some other explanation.
  256.  
  257. Anders is right--if the command-shift-anything is pressed, the ASCII code
  258. of the unshifted character is returned in event record. If the programmer
  259. wants to get the shifted character, she needs to reprocess the key code
  260. with the cmdKey bit in the modifiers field reset. This was all discussed
  261. years ago in a Tech Note called ``International Cancelling'', it gave code
  262. for correctly detecting command-period on all keyboards. 
  263.  
  264. Don't ask me where the code is in NIM, I don't know. You can also find the
  265. technique in use in the TCL source.
  266.  
  267. The trick with Mathematica is that, although it tells you to use Cmd-?, it
  268. really is looking for Cmd-/. There is a possibility that, upon finding '/'
  269. in the event record, it checks if both the shift and command keys are
  270. pressed, but that still won't help you if '?' is someplace different from
  271. it's position on the American Sholes (QWERTY) keyboard layout. 
  272.  
  273. Someday I'm gonna write an application that uses Command-‹ (that's
  274. U-Umlaut if you're not reading on a Mac), just to let some people find out
  275. what it feels like.
  276.  
  277. BTW, there is one work-around for Anders problem: switch to the U.S.
  278. keyboard layout, at least when you want to get that nifty ?-cursor. This
  279. is a pain in the neck, but there are a couple of short cuts you can
  280. take--mail me if you want details.
  281.  
  282. -- 
  283. -Peter Castine--pcastine@prz.tu-berlin.de--Process Control Center--TU Berlin-
  284. *  A New York City judge ruled that if two women behind you at the movies   *
  285. *  insist on discussing the probable outcome of the film, you have the      *
  286. *  right to turn around and blow a Bronx cheer at them.                     *
  287.  
  288. +++++++++++++++++++++++++++
  289.  
  290. >From philip@cs.wits.ac.za (Philip Machanick)
  291. Date: 19 Sep 1994 15:01:50 GMT
  292. Organization: Computer Science Dept, U of Witwatersrand
  293.  
  294. In article <35k3qr$28b@newsy.ifm.liu.se>, alun@isy.liu.se wrote:
  295.  
  296. > On my keybord the "?" is located next to the "0" (zero) key and is 
  297. > <shift>+"+". If I use the DA Keyboard and press the shift key then all
  298. > letters turn into capital letters and the "+" sign turns into a question 
  299. > mark. OK! If I now keep the shift key pressed and press the <command> key
  300. > all letter go back to normal and the "?" is transmogrified into a "+" again.
  301. > Does this happen to you? If it does and you can use <command>+"?" then I'm 
  302. > completely lost...
  303.  
  304. If I use the DA, the same thing happens yet I can use command-? in MS Word
  305. etc. Maybe Pete Resnick's article throws some light on this but it's not
  306. instantly clear why this should be different for a different keyboard
  307. layout (on the US keyboard on my PB170 "?" is SHIFT-/).
  308. -- 
  309. Philip Machanick                   philip@cs.wits.ac.za
  310. Department of Computer Science, University of the Witwatersrand
  311. 2050 Wits, South Africa        (at University of Cape Town 4 July-7 Nov)
  312. phone 27(11)716-3309  fax 27(11)339-7965
  313.  
  314. +++++++++++++++++++++++++++
  315.  
  316. >From stk@uropax.contrib.de (Stefan Kurth)
  317. Date: 20 Sep 1994 01:36:04 +0200
  318. Organization: none
  319.  
  320. In article <35jbt4$mac@newsy.ifm.liu.se>, alun@isy.liu.se (Anders
  321. Lundqvist) wrote:
  322.  
  323. > I wonder how many of you that implement keyboard shortcuts 
  324. > like <command>+? realize that these DO NOT work on many 
  325. > international keyboard layouts like the swedish????
  326. > Why? Because in order to produce a question mark I need to 
  327. > use the shift key and since the command key disables the shift
  328. > key, this doesn't work.
  329. >
  330. > IS THIS PROBLEM MENTIONED IN THE HUMAN INTERFACE GUIDELINES???
  331.  
  332. It is mentioned in NIM: Text, page C-23. And if all programs were
  333. well-behaved and handled these things like Apple tells us, you would
  334. have no problems.
  335.  
  336. The solution is to strip the cmdKey bit from theEvent.modifiers, and
  337. then run it through KeyTrans() again before passing it to MenuKey().
  338.  
  339. (BTW, I just tried it in Disinfectant, and it works fine for me; and I
  340.  have a German keyboard which I guess is similar to yours.)
  341.  
  342. Actually, some programs don't check for command-? at all, but instead
  343. they check whether the shift key is down, and if it is, they check for
  344. command-/ (because shift-/ yields ? on a US keyboard). Thus, you might
  345. try command-shift-/ on your keyboard and see if it works.
  346.  
  347. Cheers,
  348.   -Stefan
  349.  
  350. ________________________________________________________________________
  351. Stefan Kurth                 Berlin, Germany              stk@contrib.de
  352.  
  353. +++++++++++++++++++++++++++
  354.  
  355. >From quinn@cs.uwa.edu.au (Quinn "The Eskimo!")
  356. Date: Tue, 20 Sep 1994 11:30:09 +0800
  357. Organization: Department of Computer Science, The University of Western Australia
  358.  
  359. In article <35jbt4$mac@newsy.ifm.liu.se>, alun@isy.liu.se wrote:
  360.  
  361. >Greetings all programmers!
  362.  
  363. Anders, you think *you've* got problems, us Dvorak keyboards users have to
  364. put up with certain applications (like Photoshop 2.x and BBEdit 3.0 and
  365. certain bits of HC 2.x) where it ignores the command-key table in the KCHR
  366. and decides to use Dvorak command keys instead of QWERTY ones.  Do you
  367. have any idea how annoying it is to hit command-X (to do a Cut) and have
  368. the application quit.  *grrr*
  369. -- 
  370. Quinn "The Eskimo!"        "Kids, 3D and driving just don't mix."
  371.   So many gumbies, so few ICBMs.
  372.   Still using BBEdit 2.3.2.
  373.  
  374. +++++++++++++++++++++++++++
  375.  
  376. >From h+@nada.kth.se (Jon W{tte)
  377. Date: Tue, 20 Sep 1994 10:36:02 +0200
  378. Organization: Royal Institute of Something or other
  379.  
  380. In article <35jbt4$mac@newsy.ifm.liu.se>,
  381. alun@isy.liu.se (Anders Lundqvist) wrote:
  382.  
  383. >IS THIS PROBLEM MENTIONED IN THE HUMAN INTERFACE GUIDELINES???
  384.  
  385. Yes, it is. Applications are suggested only to use letters, and 
  386. where they use non-letters, to do the keyboard translation 
  387. themselves using KeyTrans with the command key stripped off
  388. or something to that effect.
  389.  
  390. The easy thing for a user to do is to extract the Swedish 
  391. keyboard layout in ResEdit and change it to care about shift 
  392. with command down (that's just a simple re-binding)
  393.  
  394. However, you immediately get a new problem; cmd-shift-digit 
  395. means FKEY, and the international shifted numbers aren't the 
  396. same as the US ones (on my keyboard, from 1 through 0, it's:
  397. bang quote hash sun percent ampersand slash leftparen 
  398. rightparen equal, or as you may, potion amulet sink unknown 
  399. food demon wawwnd tool armor ring :-)
  400.  
  401. Now, FoxPro for Macintosh uses cmd-F1 cmd-F2 etc for commands 
  402. that aren't edit commands, so it could be worse (I don't have 
  403. command keys on my keyboard) But then, FPfM says it supports 
  404. the full power of AppleEvents and AppleScripts, when the only 
  405. non-required AE they support is the DoScript one. Lame, and 
  406. misleading.
  407.  
  408. Cheers,
  409.  
  410.                     / h+
  411.  
  412.  
  413. --
  414.   Jon W‰tte (h+@nada.kth.se), Hagagatan 1, 113 48 Stockholm, Sweden
  415.  V}ga v{gra nonkonformism!
  416.  
  417.  
  418. +++++++++++++++++++++++++++
  419.  
  420. >From pcastine@prz.tu-berlin.de (Peter Castine)
  421. Date: Tue, 20 Sep 1994 10:00:17 GMT
  422. Organization: Process Control Center
  423.  
  424. In article <35l794$s3j@uropax.contrib.de>, stk@uropax.contrib.de (Stefan
  425. Kurth) wrote:
  426.  
  427. > Actually, some programs don't check for command-? at all, but instead
  428. > they check whether the shift key is down, and if it is, they check for
  429. > command-/ (because shift-/ yields ? on a US keyboard). Thus, you might
  430. > try command-shift-/ on your keyboard and see if it works.
  431.  
  432. The problem is that this won't work if the slash (/) itself is a shift-key
  433. combination as it is, for instance, on the German keyboard (/ == shift-7).
  434.  
  435. So, the only solution for Anders' problem (short of switching to the U.S.
  436. keyboard layout) seems to be to use QuicKeys. Of course, if the command
  437. isn't available in a menu somewhere, he won't have luck with that, either.
  438.  
  439. I sense a moral here: Don't implement command-key shortcuts that *aren't*
  440. available through menus. Hey, if the cmd-key equivalents were for menu
  441. commands, Anders could just tweak the appropriate resources. (Won't work
  442. for MS products, but, hey, nothing works for MS products ;-} ).
  443.  
  444. Cheers
  445.  
  446. -- 
  447. -Peter Castine--pcastine@prz.tu-berlin.de--Process Control Center--TU Berlin-
  448. *  A New York City judge ruled that if two women behind you at the movies   *
  449. *  insist on discussing the probable outcome of the film, you have the      *
  450. *  right to turn around and blow a Bronx cheer at them.                     *
  451.  
  452. +++++++++++++++++++++++++++
  453.  
  454. >From rollin@newton.apple.com (Keith Rollin)
  455. Date: Wed, 21 Sep 1994 04:06:34 -0800
  456. Organization: Apple ][ -> Mac -> Taligent -> Newton -> Windows?
  457.  
  458. In article <35jbt4$mac@newsy.ifm.liu.se>, alun@isy.liu.se wrote:
  459.  
  460. >I wonder how many of you that implement keyboard shortcuts 
  461. >like <command>+? realize that these DO NOT work on many 
  462. >international keyboard layouts like the swedish????
  463.  
  464. FYI, the '?' key is shifted on US layouts, too.
  465.  
  466.  
  467. >
  468. >Why? Because in order to produce a question mark I need to 
  469. >use the shift key and since the command key disables the shift
  470. >key, this doesn't work. I have been playing around with the DA
  471. >Keyboard and there's simply no way around. Obiwan uses <command>+`
  472. >and this I can emulate by pressing <command>+<option>+<control>+'.
  473. >Sigh...
  474. >
  475. >Of course, this wouldn't been so bad if there was an equivalent 
  476. >meny command, but in many cases there isn't. Usually <command>+?
  477. >invokes some help mode and turns the pointer into a question mark
  478. >to allow the user to point at an object (e.g Disinfectant and 
  479. >Mathematica). 
  480. >
  481. >IS THIS PROBLEM MENTIONED IN THE HUMAN INTERFACE GUIDELINES???
  482.  
  483. There's a technote called "International Canceling" that deals with this
  484. issue. It focuses on the fact that '.' is sometimes a shifted character
  485. (the technote cites the Italian keyboard as an example), and shows how to
  486. get around the fact that Shift is ignored when Command is pressed. If
  487. programmers care to get it right, the information is available.
  488.  
  489. - --------------------------------------------------------------------------
  490. Keith Rollin --- Phantom Programmer --- Apple Computer, Inc. --- Team Newton
  491.  
  492. ---------------------------
  493.  
  494. >From westwig@msc.cornell.edu (Erik Anton Westwig)
  495. Subject: Apple Events Question
  496. Date: Wed, 21 Sep 1994 10:11:54 -0500
  497. Organization: Cornell University
  498.  
  499. I'm trying to finally learn about Apple Events, but I'm having some
  500. problems
  501. understanding something quite fundamental:
  502.  
  503. Consider the first required AE: Open Application
  504.   When the Finder starts my App, it calls the Process Manager to launch it
  505.   and then sticks a kAEOpenApplication high-level event into my queue. I
  506.   think I got that part, but because I want my app to be as friendly as
  507.   possible to older systems (without AEs) I wouldn't want to stick ANY code
  508.   in the OpenApp routine that is necessary to the starting of my program.
  509.   I can't see what I would do differently in the OpenApp routine than I
  510.   would do in the non AE environment --> so I guess what I'm saying is I
  511. don't
  512.   understand why this is an important event to support.
  513.   Am I completely missing the whole point here, or what?
  514.  
  515. I think I see how the QuitApp event is different: it gives my App a chance
  516. to
  517. shut down itself gracefully (e.g. asking the user if they want to save open
  518. documents, etc.)
  519.  
  520. Thanks,
  521. ERIK
  522.  
  523. +++++++++++++++++++++++++++
  524.  
  525. >From Jeremy@dewey.soe.berkeley.edu (Jeremy Roschele)
  526. Date: Wed, 21 Sep 1994 08:09:28 -0800
  527. Organization: SimCalc Project
  528.  
  529. In article <westwig-210994101154@132.236.102.71>, westwig@msc.cornell.edu
  530. (Erik Anton Westwig) wrote:
  531.  
  532. >   I can't see what I would do differently in the OpenApp routine than I
  533. >   would do in the non AE environment --> so I guess what I'm saying is I
  534. > don't
  535. >   understand why this is an important event to support.
  536. >   Am I completely missing the whole point here, or what?
  537.  
  538. On the Open Application event you should create a blank document. The
  539. Finder won't send OApp if it is printing, or the user launched with a
  540. document.
  541.  
  542. jeremy
  543.  
  544. +++++++++++++++++++++++++++
  545.  
  546. >From jwbaxter@olympus.net (John W. Baxter)
  547. Date: Wed, 21 Sep 1994 13:26:08 -0700
  548. Organization: Internet for the Olympic Peninsula
  549.  
  550. In article <westwig-210994101154@132.236.102.71>, westwig@msc.cornell.edu
  551. (Erik Anton Westwig) wrote:
  552.  
  553. > I'm trying to finally learn about Apple Events, but I'm having some
  554. > problems
  555. > understanding something quite fundamental:
  556. > Consider the first required AE: Open Application
  557. >   When the Finder starts my App, it calls the Process Manager to launch it
  558. >   and then sticks a kAEOpenApplication high-level event into my queue. I
  559. >   think I got that part, but because I want my app to be as friendly as
  560. >   possible to older systems (without AEs) I wouldn't want to stick ANY code
  561. >   in the OpenApp routine that is necessary to the starting of my program.
  562. >   I can't see what I would do differently in the OpenApp routine than I
  563. >   would do in the non AE environment --> so I guess what I'm saying is I
  564. > don't
  565. >   understand why this is an important event to support.
  566. >   Am I completely missing the whole point here, or what?
  567.  
  568. When your application starts, and realizes that Apple events are active
  569. (all my apps realize that, because I don't write for System 6 any more),
  570. it should do what needs to be done every time it starts up.  None of this
  571. will be visible to a user.
  572.  
  573. When an Open Application event comes in, the app should do what it does
  574. when it is double-clicked on in the Finder.  Often, that is to create and
  575. open a new untitled document...sometimes it isn't.  At one time, Apple
  576. suggested not doing that if an Open Application appears after the app is
  577. happily doing things.  Recently, it seems that Apple may in the future
  578. want the open a new untitled document behavior in that case, as an
  579. "improvement" to the Mac look and feel.  So you probably should just go
  580. ahead and handle Open Application whenever it shows up.
  581.  
  582. When an Open Document comes in before the Open Application, it means that
  583. one or more docs were double-clicked rather than your application. 
  584. Normally, you would open them (assuming that's what your application
  585. does).  Print Document may appear rather than Open Document...this becomes
  586. more important with QuickDraw GX than it was with most users before, since
  587. it's how you find out that a user has dragged one of your docs to a
  588. desktop printer.
  589.  
  590. Another possibility is that an 'ascr'/'noop'  (I think 'noop' is right)
  591. event appears.  Something else will happen later.  Most apps can simple
  592. ignore this event, which says "I'll tell you later why you were started". 
  593. But some apps may need to know.
  594.  
  595.    --John
  596.  
  597. -- 
  598. John Baxter    Port Ludlow, WA, USA  [West shore, Puget Sound]
  599.    "Occasionally...astronomers add a second to either June 31 or
  600.     December 31..."   IM: OS Utilities, p 4-12
  601.    jwbaxter@pt.olympus.net
  602.  
  603. +++++++++++++++++++++++++++
  604.  
  605. >From westwig@msc.cornell.edu (Erik Anton Westwig)
  606. Date: Wed, 21 Sep 1994 18:35:46 -0500
  607. Organization: Cornell University
  608.  
  609. In article <Jeremy-2109940809280001@now-and-zen.hip.berkeley.edu>,
  610. Jeremy@dewey.soe.berkeley.edu (Jeremy Roschele) wrote:
  611.  
  612. > On the Open Application event you should create a blank document. The
  613. > Finder won't send OApp if it is printing, or the user launched with a
  614. > document.
  615. > jeremy
  616.  
  617. yup, i get that part.  But what I don't see is what I need to do
  618. differently
  619. than before (without the AEs).  To be pre system 7 friendly, I need to be
  620. able
  621. to open my blank document without using the KAEOpenApplication event,
  622. anyway.
  623.  
  624. ERIK
  625.  
  626. +++++++++++++++++++++++++++
  627.  
  628. >From jwbaxter@olympus.net (John W. Baxter)
  629. Date: Wed, 21 Sep 1994 19:42:44 -0700
  630. Organization: Internet for the Olympic Peninsula
  631.  
  632. In article <westwig-210994183547@132.236.102.67>, westwig@msc.cornell.edu
  633. (Erik Anton Westwig) wrote:
  634.  
  635. > In article <Jeremy-2109940809280001@now-and-zen.hip.berkeley.edu>,
  636. > Jeremy@dewey.soe.berkeley.edu (Jeremy Roschele) wrote:
  637. >  
  638. > > On the Open Application event you should create a blank document. The
  639. > > Finder won't send OApp if it is printing, or the user launched with a
  640. > > document.
  641. > > 
  642. > > jeremy
  643. > yup, i get that part.  But what I don't see is what I need to do
  644. > differently
  645. > than before (without the AEs).  To be pre system 7 friendly, I need to be
  646. > able
  647. > to open my blank document without using the KAEOpenApplication event,
  648. > anyway.
  649.  
  650. The sample code in Inside Mac: IAC shows how to detect whether you should
  651. wait for the 'oapp' because it's coming, or not.  I think the discussion
  652. in Think Reference also does.  --John
  653.  
  654. -- 
  655. John Baxter    Port Ludlow, WA, USA  [West shore, Puget Sound]
  656.    "Occasionally...astronomers add a second to either June 31 or
  657.     December 31..."   IM: OS Utilities, p 4-12
  658.    jwbaxter@pt.olympus.net
  659.  
  660. +++++++++++++++++++++++++++
  661.  
  662. >From h+@nada.kth.se (Jon W{tte)
  663. Date: Thu, 22 Sep 1994 16:11:18 +0200
  664. Organization: Royal Institute of Something or other
  665.  
  666. In article <westwig-210994183547@132.236.102.67>,
  667. westwig@msc.cornell.edu (Erik Anton Westwig) wrote:
  668.  
  669. >yup, i get that part.  But what I don't see is what I need to do
  670. >differently
  671. >than before (without the AEs).  To be pre system 7 friendly, I need to be
  672. >able
  673. >to open my blank document without using the KAEOpenApplication event,
  674. >anyway.
  675.  
  676. Well, the logic goes like this:
  677.  
  678. On startup:
  679.  
  680. if (hasn't got AppleEvents) then
  681.     if (CountAppFiles) then
  682.         Open or Print files
  683.     else
  684.         Make new document
  685. else
  686.     Install AppleEvent Handlers
  687.  
  688.  
  689. on OpenApplication:
  690.     Make new document
  691.  
  692. on OpenDocument:
  693.     Open files
  694.  
  695. on PrintDocument:
  696.     Print files
  697.  
  698.  
  699. As you see, you should separate the actions (opening/printing 
  700. documents or making new documents) from their triggers 
  701. (starting up and/or choosing the menu items)
  702.  
  703. For instance, you wouldn't want your app to create a blank 
  704. document before receiving an open documents appleevent when the 
  705. user double-clicks a document in the Finder under system 7.
  706.  
  707. Cheers,
  708.  
  709.                 / h+
  710.  
  711.  
  712. --
  713.   Jon W‰tte (h+@nada.kth.se), Hagagatan 1, 113 48 Stockholm, Sweden
  714.  
  715. "TextEdit does everything right."
  716.     ã Jon W{tte
  717.  
  718.  
  719. ---------------------------
  720.  
  721. >From jumplong@aol.com (Jump Long)
  722. Subject: File System Manager Software Development Kit
  723. Date: 15 Sep 1994 00:28:01 -0400
  724. Organization: America Online, Inc. (1-800-827-6364)
  725.  
  726. Apple Developers:
  727.  
  728. The File System Manager Software Development Kit (SDK) version 1.2 is
  729. available on Apple's ftp server at:
  730.  
  731. ftp.apple.com (IP 130.43.2.3)
  732.  
  733. /ftp/dts/mac/sys.soft/extensions/file-system-manager-sdk.hqx
  734.  
  735. The FSM SDK will be on Developer CDs and on AppleLink in the future.
  736.  
  737. Archive Contents
  738. - --------------
  739.  
  740. * File System Manager -- A system extension which implements version 1.2
  741. of FSM and the extended Disk Initialization Package. This extension is
  742. compatible with System 7.0 and later. If in future system software, we
  743. make changes to FSM, the File System Manager extension will disable
  744. itself.
  745.  
  746. * FSMGlueLib.o -- The glue code for the File System Manager service
  747. routines.
  748.  
  749. * FSM.h. FSM.p and FSM.a -- The Universal Interface files for the File
  750. System Manager. This version of the interface files was built to work with
  751. the Universal Interfaces 2.0a1 from ETO #15, MPW prerelease. However, for
  752. 68K development (which we expect all foreign file systems to be), FSM.h
  753. works perfectly with the current release of Universal Interfaces on ETO
  754. #15.
  755.  
  756. * Guide - File System Manager -- The documentation for the File System
  757. Manager in Apple DocViewer format. The latest version of the Apple
  758. DocViewer application can be found on any recent Developer CD.
  759.  
  760. Licensing Information
  761. - -------------------
  762.  
  763. The File System Manager extension version 1.2 may be licensed for
  764. distribution. Contact Apple Software Licensing at:
  765.  
  766.      Software Licensing
  767.      Apple Computer, Inc.
  768.      2420 Ridgepoint Drive, MS: 198-SWL
  769.      Austin, TX  78754
  770.      512 919-2645
  771.      AppleLink: SW.LICENSE
  772.  
  773. The File System Manager Development and Developer Support Team
  774.  
  775. (I told ya we'd make it available when it was done - Jim Luther)
  776.  
  777. +++++++++++++++++++++++++++
  778.  
  779. >From quinn@cs.uwa.edu.au (Quinn "The Eskimo!")
  780. Date: Fri, 16 Sep 1994 10:57:22 +0800
  781. Organization: Department of Computer Science, The University of Western Australia
  782.  
  783. In article <358igh$sme@search01.news.aol.com>, jumplong@aol.com (Jump
  784. Long) wrote:
  785.  
  786. >(I told ya we'd make it available when it was done - Jim Luther)
  787.  
  788. (:  Yay Jim!
  789. -- 
  790. Quinn "The Eskimo!"        "Scout in a can. Simple, cheap, easy
  791.                             to use and it's expendable!"
  792.  
  793. +++++++++++++++++++++++++++
  794.  
  795. >From jumplong@aol.com (Jump Long)
  796. Date: 17 Sep 1994 14:57:02 -0400
  797. Organization: America Online, Inc. (1-800-827-6364)
  798.  
  799. In article <rmah-1509940108340001@rmah.dialup.access.net>, rmah@panix.com
  800. (Robert Mah) writes:
  801.  
  802. >Please pardon my ignorance, but I have one question.  What does it do?
  803.  
  804. Here's some meterial cut from the FSM docs which should answer this
  805. question:
  806.  
  807. "The File System Manager is the part of the Macintosh Operating System
  808. that manages the use of foreign file systems. The File System Manager
  809. provides a general means by which foreign file systems can be installed,
  810. identified, and interfaced to the Operating System.
  811.  
  812. The Operating System services provided by the File System Manager are
  813. called FSM components and the interface mechanism between an foreign file
  814. system and a particular FSM component is known as a FSM component
  815. interface. At this time, two FSM component interface are defined for use
  816. under the File System Manager
  817.  
  818. * the HFS Component Interface which allows a foreign file system to
  819. process File Manager requests
  820.  
  821. * the Disk Initialization Package Component Interface which allows foreign
  822. file systems to initialize foreign file system volumes on a Macintosh"
  823.  
  824.  
  825. FSM also includes the File System Utility Routines which help you write a
  826. foreign file system. Here's the description of those utilities:
  827.  
  828. "The File System Utility routines are intended for use by foreign file
  829. systems to allow your foreign file system to
  830.  
  831. * access file control blocks (FCBs), volume control blocks (VCBs), working
  832. directory control blocks (WDCBs), and drive queue elements (DrvQEl)
  833.  
  834. * set and get the default volume and working directory
  835.  
  836. * eject a volume
  837.  
  838. * validate and process parameters passed with Macintosh file system calls
  839.  
  840. * access the Macintosh file system's cache buffers and low-level I/O
  841. services"
  842.  
  843.  
  844. Writing a foreign file system is by no means simple, but we've tried to
  845. make it easier to do a lot  of it.
  846.  
  847. - Jim Luther
  848.  
  849.  
  850. +++++++++++++++++++++++++++
  851.  
  852. >From quinn@cs.uwa.edu.au (Quinn "The Eskimo!")
  853. Date: Sun, 18 Sep 1994 22:37:05 +0800
  854. Organization: Department of Computer Science, The University of Western Australia
  855.  
  856. In article <35fe5u$j0m@newsbf01.news.aol.com>, jumplong@aol.com (Jump
  857. Long) wrote:
  858.  
  859. >Writing a foreign file system is by no means simple, but we've tried to
  860. >make it easier to do a lot  of it.
  861.  
  862. So I spent the weekend reading the docs and now I have a question...
  863.  
  864. How do you write an asychronous file system based on a non-block device?
  865. (eg AppleShare)  Presumably you should be using the cache routines because
  866. of this comment...
  867.  
  868. "all calls to most device drivers should be made through the cache routines."
  869.  
  870. (:
  871.  
  872. However the cache routines (eg UTCacheReadIP) seem to imply that they
  873. access the block device driver directly, because they call the
  874. log2PhyProc.  Any ideas?
  875. -- 
  876. Quinn "The Eskimo!"        "Scout in a can. Simple, cheap, easy
  877.                             to use and it's expendable!"
  878.  
  879. +++++++++++++++++++++++++++
  880.  
  881. >From jumplong@aol.com (Jump Long)
  882. Date: 18 Sep 1994 15:43:06 -0400
  883. Organization: America Online, Inc. (1-800-827-6364)
  884.  
  885. In article <quinn-1809942237050001@edu-dynamic5.educ.ecel.uwa.edu.au>,
  886. quinn@cs.uwa.edu.au (Quinn "The Eskimo!") writes:
  887.  
  888. >How do you write an asychronous file system based on a non-block device?
  889. >(eg AppleShare)  Presumably you should be using the cache routines
  890. because
  891. >of this comment...
  892. >
  893. >"all calls to most device drivers should be made through the cache
  894. routines."
  895.  
  896. Here's the answer I gave to a couple of developers during the seed to get
  897. them around this:
  898.  
  899. - ---
  900.  
  901. So, how do you use the cache routines (which are designed to work with
  902. block disk devices) with non-block devices?  You write a very simple block
  903. disk driver - one that supports one writable block.  You'll need a driver
  904. anyway to handle _Control calls with csCode 21 (return physical drive
  905. icon) because the Finder uses that control call.
  906.  
  907. The single block driver is going to be your communications channel between
  908. your FFS, which can only perform block I/O through the cache, and your
  909. non-block driver.  As an example of how this trick works, let's say your
  910. FFS needs to send a command to your WizzyNet driver.
  911.  
  912. First, your FFS needs to get a cache block and associate it with the block
  913. on your simple block driver.  It does this by calling UTGetBlock passing
  914. the volume's volume reference number for the refNum (so the cache code
  915. knows which driver to call), NULL for the log2PhyProc, 0 for the block
  916. number (the only block your driver has), and gbNoRead for the gbOption
  917. (which tells the cache code not to bother reading the block from disk). 
  918. You'll get a pointer back to a 512-byte buffer in the cache.
  919.  
  920. Next, your FFS puts whatever data is wants to send to the block driver (to
  921. send on to the WizzyNet driver) into the cache buffer.  Then, to tell the
  922. cache that the block needs to be sent to the block driver, the FFS calls
  923. UTMarkDirty with the pointer to the cache block. To tell the cache code to
  924. write the block, the FFS calls UTFlushCache.  When the cache code is
  925. called to flush the dirty block to the disk driver, it will call the block
  926. driver to write the cache block.
  927.  
  928. The block driver can then call the WizzyNet driver asynchronously with a
  929. completion routine and then RTS back to the Device Manager.  The Device
  930. Manager will then either return control to the user code or will spin in
  931. the SyncWait loop if the call was made synchronously.
  932.  
  933. When the WizzyNet driver completes the call and the Device Manager calls
  934. the completion routine in the block driver, the block driver will jump to
  935. jIODone, the Device Manager will call the completion routine in the File
  936. Manager's cache code, and the cache code will pass control back through
  937. FSM to the FFS that made the cache call.
  938.  
  939. Finally, when you're done making calls to your driver for this particular
  940. File Manager request, you call UTReleaseBlock to release the block.
  941.  
  942. So, all your block driver needs to handle is _Open, _Close, _Control, and
  943. _Write.  Since it'll never be getting _Read or _Status calls from your
  944. FFS, you can simply return readErr to _Read and statusErr to _Status
  945. requests.  The data your driver is asked to write is going to be the
  946. command or data you want to send to your non-block driver.  You might want
  947. to put a signature long-word in the cache blocks your write so that other
  948. code that mistakenly writes to your driver can be ignored if the signature
  949. isn't there.
  950.  
  951. - ---
  952.  
  953. Yes, that's a hack, but it works and it keeps your foreign file system
  954. from deadlocking the system.  There are a few published foreign file
  955. systems (I won't mention any names) that make synchronous calls to network
  956. drivers which they don't completely own.  Every once in a while, those
  957. file systems deadlock the system because: a) something interrupts while
  958. the driver they call is busy, and b) that code makes an asynchronous File
  959. Manager request and c) if the File Manager isn't busy, it passes the
  960. request on to the foreign file system which d) makes a synchronous call to
  961. the busy driver which causes the system to spin in SyncWait forever (or
  962. until you reset the system or pull the plug).
  963.  
  964. - Jim Luther
  965.  
  966. +++++++++++++++++++++++++++
  967.  
  968. >From quinn@cs.uwa.edu.au (Quinn "The Eskimo!")
  969. Date: Mon, 19 Sep 1994 09:42:25 +0800
  970. Organization: Department of Computer Science, The University of Western Australia
  971.  
  972. In article <35i58a$9bi@newsbf01.news.aol.com>, jumplong@aol.com (Jump
  973. Long) wrote:
  974.  
  975. >In article <quinn-1809942237050001@edu-dynamic5.educ.ecel.uwa.edu.au>,
  976. >quinn@cs.uwa.edu.au (Quinn "The Eskimo!") writes:
  977. >
  978. >>How do you write an asychronous file system based on a non-block device?
  979. >
  980. >Yes, that's a hack, but it works [...]
  981.  
  982. Cool.  I figured that the hack would work something like that but it's
  983. nice to know that I'm not missing something obvious.
  984.  
  985. Share and Enjoy.
  986. -- 
  987. Quinn "The Eskimo!"        "Scout in a can. Simple, cheap, easy
  988.                             to use and it's expendable!"
  989.  
  990. +++++++++++++++++++++++++++
  991.  
  992. >From peter.lewis@info.curtin.edu.au (Peter N Lewis)
  993. Date: Tue, 20 Sep 1994 10:13:20 +0800
  994. Organization: NCRPDA, Curtin University
  995.  
  996. >Cool.  I figured that the hack would work something like that but it's
  997. >nice to know that I'm not missing something obvious.
  998.  
  999. It should be possible to write a generic driver to take the place of that
  1000. block driver, something where the block is formatted like:
  1001.  
  1002. <signature>
  1003. <address to call>
  1004. <generic parameter>
  1005.  
  1006. And have the block driver call the specified address, with a ptr to the
  1007. parameters.  Once we (someone) writes this and makes it available, that
  1008. should be one less chunk we all have to write.  That should work, right?
  1009.    Peter.
  1010. -- 
  1011. Peter N Lewis <peter.lewis@info.curtin.edu.au> - Macintosh TCP fingerpainter
  1012. FTP my programs from redback.cs.uwa.edu.au:Others/PeterLewis/ or
  1013. amug.org:pub/peterlewis/ or nic.switch.ch:software/mac/peterlewis/
  1014.  
  1015. +++++++++++++++++++++++++++
  1016.  
  1017. >From jumplong@aol.com (Jump Long)
  1018. Date: 20 Sep 1994 03:08:06 -0400
  1019. Organization: America Online, Inc. (1-800-827-6364)
  1020.  
  1021. In article <peter.lewis-2009941013200001@rocky.curtin.edu.au>,
  1022. peter.lewis@info.curtin.edu.au (Peter N Lewis) writes:
  1023.  
  1024. >It should be possible to write a generic driver to take the place of
  1025. >that block driver, something where the block is formatted like:
  1026. >
  1027. ><signature>
  1028. ><address to call>
  1029. ><generic parameter>
  1030. >
  1031. >And have the block driver call the specified address, with a ptr to the
  1032. >parameters.  Once we (someone) writes this and makes it available, that
  1033. >should be one less chunk we all have to write.  That should work, right?
  1034.  
  1035. That looks like you're planning on calling <address to call> synchronously
  1036. and that won't work. When the block driver gets a request (either
  1037. asynchronously or synchronously - this method works for both), the block
  1038. driver should:
  1039.  
  1040. 1) Call the network driver asynchronously with a completion routine
  1041. 2) RTS back to the Device Manager
  1042. 3) When the completion routine is executed, jump to ioDone to finish up
  1043. the call.
  1044.  
  1045. The reason it should do it that way is that the network driver could be
  1046. busy. If that's the case, then the request will be queued for execution
  1047. later. The Device Manager will return control to the file system's cache
  1048. code (which called the block driver) and the file system will do one of
  1049. two things: 1) if the original File Manager request was synchronous, it
  1050. will spin in SyncWait until the device request's ioResult field is less
  1051. than or equal to noErr or 2) if the original File Manager request was
  1052. asynchronous, it will return control to the caller.  Either way, when the
  1053. network driver completes its request and the Device Manager calls the
  1054. block driver's completion routine and the block driver calls the File
  1055. Manager's completion routine (or the SyncWait loop code sees ioResult
  1056. change), then control will be returned to the Foreign File System that
  1057. used the cache.
  1058.  
  1059. So, if you're going to write some kind of generic block driver, then you
  1060. should only need to pass it a block with a structure like this:
  1061.  
  1062. enum
  1063. {
  1064.     kReadRequest = 1,
  1065.     kWriteRequest = 2,
  1066.     kControlRequest = 3,
  1067.     kStatusRequest = 4
  1068. };
  1069.  
  1070. struct CallDriverStruct
  1071. {
  1072.     OSType: mySignature; /* the creator type of my foreign file system */
  1073.                          /* to help stop unknown writers */
  1074.     short: callToMake;   /* pass kReadRequest, kWriteRequest, etc. to */
  1075.                          /* tell block driver which driver call to make.
  1076. */
  1077.     ParamBlockRec: pb;   /* parameter block to make driver call with. */
  1078. };
  1079.  
  1080. All of that fits easily into a 512-byte cache block and you don't have to
  1081. worry about the parameter block moving or being reused since cache blocks
  1082. you get with UTGetBlock are yours until you release them (and they don't
  1083. move in memory - ever).
  1084.  
  1085. All of this is off the top of my somewhat sleepy head, so I hope it makes
  1086. sense. If you get something working and want a code review, let me know.
  1087. If I have time, I'll write it...
  1088.  
  1089. - Jim Luther
  1090.  
  1091.  
  1092. +++++++++++++++++++++++++++
  1093.  
  1094. >From benh@fdn.org (Benjamin Herrenschmidt)
  1095. Date: Wed, 21 Sep 94 23:00:53 +0100
  1096. Organization: (none)
  1097.  
  1098. Hi !
  1099.  
  1100. I was away from the usenet for some days (AppleExpo in Paris) and
  1101. i missed the beginning of this thread. The API to the File System
  1102. Manager is available somewhere ? I am interested....
  1103.  
  1104. BenH.
  1105.  
  1106. ---------------------------
  1107.  
  1108. >From gwatts@whcdfo.fnal.gov
  1109. Subject: GDGX Graphics Shell bus errors with GX Beta 3...
  1110. Date: 19 Sep 94 09:17:28 -0600
  1111. Organization: Fermi National Accelerator Lab
  1112.  
  1113. Hi all,
  1114.   I'm trying to teach myself some QDGX graphics this week. :)
  1115.   Short story is I built GDGX Graphics Shell with MW and I get a trashed
  1116. stack ("sc" in Macsbug says my stack pointer is odd!).  The precompiled version
  1117. on the develop CD bombs with a bus error as well.  Details next:
  1118.   I thought I would start by building the QDGX Graphics shell from Develop 15.
  1119. I pulled the source code from develop 19, and I'm using beta 3 of GX (I don't 
  1120. system 7.5 yet, just 7.1).  The app on the disk crashed my mac with a bus error.
  1121. So, I decided to recompile everything.
  1122.   I'm using MW D/4.  First thing I have to do is #define ppcinterfaces in all
  1123. the source files (including the library files!).  Second, the shell sources
  1124. won't compile as is.  There is a routine GXQDGlobalToFixedLocal, for example,
  1125. that doesn't exist in any of the gx .h files.  I replaced it with
  1126. ConvertGXPoint, and used the parent view port of gcontentWindow to get the
  1127. local coords correct.  When creating the "runFeatures" for the styled layout
  1128. shape, the second feather (alternateblahblah) doesn't exist in gx anylonger.
  1129. Is that right?  For the time being, I've just removed it.
  1130.   So, what did I miss.  Do I have to do a #pramga parameters_in_a0 or something
  1131. like that around the gx interfaces?  Why isn't this done automagically, if I
  1132. do have to do it.
  1133.   I only just started last night, so I've not done a detailed step through
  1134. the program yet.  I just figured that others starting out with GX may have
  1135. seen the same thing, and save me some time.  Thought changing the to the
  1136. ConvertQDPoint taught me a bit about viewport coord systems!
  1137.   Any help would be great!  TIA.
  1138.  
  1139.     Cheers,
  1140.         Gordon.
  1141.  
  1142. +++++++++++++++++++++++++++
  1143.  
  1144. >From dkj@apple.com (Dave Johnson)
  1145. Date: Wed, 21 Sep 1994 17:56:24 GMT
  1146. Organization: Apple Computer
  1147.  
  1148. In article <1994Sep19.091728.1@whcdfo.fnal.gov>, gwatts@whcdfo.fnal.gov wrote:
  1149.  
  1150. >   I thought I would start by building the QDGX Graphics shell from Develop 15.
  1151. > I pulled the source code from develop 19, and I'm using beta 3 of GX (I don't 
  1152. > system 7.5 yet, just 7.1).  The app on the disk crashed my mac with a
  1153. bus error.
  1154.  
  1155. The QDGX Shell on the CDs was compiled for, and runs under, beta 1 of GX
  1156. (and without universal interfaces). It was never updated for beta 3,
  1157. unfortunately. The quick and (very) dirty way to get it up and running
  1158. would be to install beta 1 (it's on the issue 15 CD) and use old headers.
  1159. Not recommended.
  1160.  
  1161. > So, I decided to recompile everything.
  1162. >   I'm using MW D/4.  First thing I have to do is #define ppcinterfaces in all
  1163. > the source files (including the library files!).
  1164.  
  1165. It actually might be better to #define it in either a "prefix" file (if
  1166. you're not using precompiled headers) or in a .h file that you include
  1167. before any other headers.
  1168.  
  1169. > Second, the shell sources
  1170. > won't compile as is.  There is a routine GXQDGlobalToFixedLocal, for example,
  1171. > that doesn't exist in any of the gx .h files.  I replaced it with
  1172. > ConvertGXPoint, and used the parent view port of gcontentWindow to get the
  1173. > local coords correct.
  1174.  
  1175. Excellent exercise! :-) That routine went away between beta 1 and beta 3.
  1176.  
  1177. >   So, what did I miss.  Do I have to do a #pramga parameters_in_a0 or
  1178. something
  1179. > like that around the gx interfaces?
  1180.  
  1181. Here's the recommended "prefix" file for MW, most of which came from the GX SDK:
  1182.  
  1183. ///
  1184.  
  1185. #define ppcinterfaces
  1186.  
  1187. #ifndef powerc
  1188.    // The following two typedef's are to work around a bug in the ETO #15
  1189.    // Universal headers -- the headers only typedef float_t and double_t
  1190.    // for "applec" and "powerc".  When this is eventually fixed, these
  1191.    // lines will generate "redefined type" errors.
  1192.  
  1193.    typedef long double float_t;
  1194.    typedef long double double_t;
  1195.  
  1196.    // The following is required if using Metrowerks 68K (CW4).
  1197.    // Otherwise, MetroWerks 68K expects (and uses what it thinks are)
  1198.    // A0 result values instead of D0 ones.
  1199.  
  1200.    #pragma pointers_in_D0     // Required for c-style toolbox glue.
  1201. #endif
  1202.  
  1203. ///
  1204.  
  1205. On the November CDs (Bookmark 20 and Reference Library), the beta 1 GX
  1206. shell will probably be replaced with the "modern" version that comes with
  1207. the SDK (I still have to get buyoff for that, but I don't anticipate any
  1208. problems). It uses the release version of GX, and the code has been
  1209. cleaned up in a big way. Frankly I wouldn't recommend the old one any
  1210. more, except as an "exercise for the reader."
  1211.  
  1212. Have fun!
  1213.  
  1214. Dave Johnson
  1215. Technical Buckstopper
  1216. d e v e l o p
  1217.  
  1218. +++++++++++++++++++++++++++
  1219.  
  1220. >From lalonde@metrowerks.ca (Paul Lalonde)
  1221. Date: Thu, 22 Sep 1994 11:24:47 GMT
  1222. Organization: Metrowerks
  1223.  
  1224. In article <1994Sep19.091728.1@whcdfo.fnal.gov>, gwatts@whcdfo.fnal.gov wrote:
  1225.  
  1226. > Hi all,
  1227. >   I'm trying to teach myself some QDGX graphics this week. :)
  1228. >   Short story is I built GDGX Graphics Shell with MW and I get a trashed
  1229. > stack ("sc" in Macsbug says my stack pointer is odd!).  The precompiled
  1230. version
  1231. > on the develop CD bombs with a bus error as well.  Details next:
  1232. >   I thought I would start by building the QDGX Graphics shell from Develop 15.
  1233. > I pulled the source code from develop 19, and I'm using beta 3 of GX (I don't 
  1234. > system 7.5 yet, just 7.1).  The app on the disk crashed my mac with a
  1235. bus error.
  1236. > So, I decided to recompile everything.
  1237. >   I'm using MW D/4.  First thing I have to do is #define ppcinterfaces in all
  1238. > the source files (including the library files!).  Second, the shell sources
  1239. > won't compile as is.  There is a routine GXQDGlobalToFixedLocal, for example,
  1240. > that doesn't exist in any of the gx .h files.  I replaced it with
  1241. > ConvertGXPoint, and used the parent view port of gcontentWindow to get the
  1242. > local coords correct.  When creating the "runFeatures" for the styled layout
  1243. > shape, the second feather (alternateblahblah) doesn't exist in gx anylonger.
  1244. > Is that right?  For the time being, I've just removed it.
  1245. >   So, what did I miss.  Do I have to do a #pramga parameters_in_a0 or
  1246. something
  1247. > like that around the gx interfaces?  Why isn't this done automagically, if I
  1248. > do have to do it.
  1249. >   I only just started last night, so I've not done a detailed step through
  1250. > the program yet.  I just figured that others starting out with GX may have
  1251. > seen the same thing, and save me some time.  Thought changing the to the
  1252. > ConvertQDPoint taught me a bit about viewport coord systems!
  1253. >   Any help would be great!  TIA.
  1254. >         Cheers,
  1255. >                 Gordon.
  1256.  
  1257. I've been through this problem, and what I did was make myself a precompiled 
  1258. header whose source file included all of the GX headers.  Everything was then 
  1259. wrapped between #pragma parameters_in_d0 and #pragma parameters_in_a0.  Then 
  1260. things started working :)
  1261.  
  1262. You see, contrary to almost the whole Toolbox, the GX graphics routines use 
  1263. the C calling convention.  Problem is, those conventions vary from one compiler 
  1264. to the next.  Hence the need for the #pragma.
  1265.  
  1266. Also, if you're looking for those missing " alternateblahblah" declarations, 
  1267. there's a demo on the develop 17 CD (*not* called "QDGX Graphics shell", 
  1268. though) that puts up the same graphic as the shell on the develop 15 CD, 
  1269. so you can just cut and paste.
  1270.  
  1271. Note:  The headers changed between B1 and B3.  Be sure you're using the right 
  1272. headers for the version you're running.
  1273.  
  1274.  
  1275. Paul Lalonde
  1276. lalonde@metrowerks.ca
  1277.  
  1278. ---------------------------
  1279.  
  1280. >From stone@phoenix.cs.uga.edu (Robert)
  1281. Subject: Getting Started (Summary)
  1282. Date: 17 Sep 1994 23:45:40 GMT
  1283. Organization: kind of sloppy actually....
  1284.  
  1285. Thanks to everyone who sent responses to me.  Here's a compilation of some of
  1286. what I got when I asked about getting started with Macintosh programming for
  1287. around $200.  Hopefully this will prove helpful to others out there who are
  1288. toying with the idea of attempting to learn Mac programming.
  1289.  
  1290.  
  1291. >From Gary M. Greenberg <garyg@UFCC.UFL.EDU>
  1292.  
  1293. Part of what you do should depend on how much _other_ programming
  1294. background you have. Many newbies to the Mac are highly or fairly
  1295. experienced on other platforms. If that's you, then get the biggest,
  1296. baddest, _mostest_ package you can find (maybe even get SC++7.__ and CW
  1297. Gold).
  1298.  
  1299. On the other hand, if you're like me and you have no (zero) former
  1300. programming experience, _and_ you're teaching yourself rather than studying
  1301. CS at a university, then any ANSI C compiler and good books will be fine.
  1302.  
  1303. I've been teaching myself how to code for a few months but I've only had a
  1304. few actual weeks of time to spend working at it. Still, I've gotten through
  1305. 7 chapters of the Waite Group's C Primer Plus, and I'm concurrently reading
  1306. K&R's The C Programming Language, 2nd Edition. I'm also chipping away at a
  1307. new book called Symantec C++ Programming for the Macintosh (with Diskette
  1308. for about $35.00). I bought SC++6.0 for $50.00 and got the free upgrades
  1309. from the SC FTP site. I'm sure that the OO Libraries are about 6-12 months
  1310. beyond my reach given the limited time I can invest in learning right now,
  1311. but I expect a geometric progression -- you should too.
  1312.  
  1313. I've spent more on books than any other resource. The books on CD are okay
  1314. if that is all money will permit, but you'll become hungry for the paper
  1315. soon, as too much screen time weakens one's concentration. I've used them
  1316. enough to know. And, I now subscribe to MacTech and Develop. I've written
  1317. some very small _useless_ programs/exercises (and had fun each minute
  1318. making them work) so my method is having a positive result. Books, source
  1319. code, following c.s.m.p. and a.s.m. (that's alt.sources.mac) and lots of
  1320. keystrokin' is what will bring it all together for you and the tool you
  1321. choose (the brand of programming environment) will be less important.
  1322. You'll see lots of passionate hooey about all the brands. Each has lovers
  1323. and haters (I personally can't wait til my skills become sharp enough that
  1324. I feel comfortable tackling Smalltalk) but they are only _tools_.
  1325.  
  1326. I firmly believe that after you are successful at learning a language,
  1327. you'll move around and experiment with many different types of tools. So,
  1328. $200 [hey, I made it back to your topic ;-) ] is a comfortable starting
  1329. point ...
  1330. yet, it's just that ... a starting point.
  1331.  
  1332.  
  1333. >From Tim Dixon  <tdixon@css.tayloru.edu>
  1334.  
  1335. If you're a student (or perhaps faculty, I don't know) CodeWarrior Gold is
  1336. available at the educational price of $99.  Call 1-800-377-5416 for details.
  1337.  
  1338. [Regarding having a friend who's a student order for you:]
  1339.  
  1340. That should work.  A friend and I placed our orders at the same time.  We
  1341. had to place separate orders, but they let us both use his credit card (I
  1342. don't have one so I paid him by check).  They'll also accept a check.
  1343.  
  1344.  
  1345. >From Peter S. Lau:
  1346.  
  1347. well, CodeWarrier is quiet good, and you can tell by the recent
  1348. created and active newsgroup comp.sys.mac.programmer.codewarrier.  I
  1349. think $99 to get the compiler (actually 3 compilers C, C++, and
  1350. Pascal), plus tools, plus class library is definitely a bargain.  I
  1351. have used the demo version in Thomson's book.  I feel quiet
  1352. comfortable with it.
  1353.  
  1354. A few third-party books are good, too.  "Macintosh Programming Secrets" 2nd
  1355. edition is good.  I found it a bit wordy, but the examples are practical, so
  1356. that's the good part.  You might want to check the library.
  1357.  
  1358.  
  1359. >From Robert B. Schmunk <pcrxs@nasagiss.giss.nasa.gov>
  1360.  
  1361. The develop Bookmark CD no longer contains all the NIM books, but if you
  1362. request a copy of issue #17 (backissues cost about $10), I understand that
  1363. all that had been released before spring 1994 they're all on that one. To
  1364. get the newer ones, you'll need to subscribe, which is something like $37
  1365. for four issues. Supposedly, Addison-Wesley will be publishing a CD sometime
  1366. in the next couple months which contains nothing but a complete NIM (the
  1367. Bookmark CD contains lots more), and the street price will supposedly be
  1368. around $99.
  1369.  
  1370.  
  1371. >From Eric Drumbor <ericd@netcom.com>
  1372.  
  1373.      I would check around for used books.  I purchased volumes 1-6, the 
  1374. X-Reference, and a book on the Communications Toolbox (this was all from 
  1375. the old series) for $30.  The CDs are nice to have, but it's much easier 
  1376. to have a book to use as a reference.
  1377.  
  1378.      I don't know what you have as far as beginners programming books (if 
  1379. you actually need them), but I would recommend either Learn C on the 
  1380. Macintosh and The C Programming Primer from Dave Mark, or Think THINK C 
  1381. by Dan Parks Sydow (Sydow has also written another "intermediate" book 
  1382. that explains more about the Macintosh Toolbox commands).  Mark's books 
  1383. are fairly good, but I think Sydow has a better understanding on how to 
  1384. teach and what needs to be explained.
  1385.  
  1386.      What I've suggested goes over the $200 mark, but I'd recommend that 
  1387. you get Code Warrior and some kind of C book before you get a Develop 
  1388. subscription.  I've spent over $600 in books alone, and I'm still waiting 
  1389. for my next paycheck to buy some more.  Hope this helps..good luck!
  1390.  
  1391.  
  1392.  
  1393. @@@@@ Robert Stone (stone@phoenix.cs.uga.edu)
  1394. @@@@@ Some Sort of Computer-Related Person, UGA - Extension Dairy Sci.
  1395. @@@@@ I am not responsible for anything I might say.
  1396.  
  1397.  
  1398. +++++++++++++++++++++++++++
  1399.  
  1400. >From kenlong@netcom.com (Ken Long)
  1401. Date: Mon, 19 Sep 1994 04:04:17 GMT
  1402. Organization: NETCOM On-line Communication Services (408 261-4700 guest)
  1403.  
  1404. If someone wanted to program on the Mac and had minimal finances, and 
  1405. could only afford a used Think C package, then what could they get to 
  1406. learn more?
  1407.  
  1408. Kernighan on C - a big text (w.p.) document by Brian Kernigan on the C 
  1409. language, SpInside Mac, and as much example source as could be found and 
  1410. downloaded.  The books are all expensive and many only give you example 
  1411. code and a book full of comments.  Some have useful info not found in 
  1412. example code, but is it absolutely necessary for the price?
  1413.  
  1414. I've found few source examples in books (or on the extra disks you'd buy) 
  1415. that did not have similar or identical example sources somewhere in 
  1416. cyberspace.  And there are a LOT more examples in cyberspace that you'd 
  1417. not see in any bought book.
  1418.  
  1419. I'm not against buying programming books - especially IM.  I've got 
  1420. plenty of money tied up in them!  But if you don't have any money, 
  1421. example source and SpInside Mac is your route.  As far as value in 
  1422. programmer training, I'd say IM, example source and programmer message 
  1423. forums are far superior than Mac programming books.  Think C 5's Standard 
  1424. Libraries manual was a real close second to K&R's.
  1425.  
  1426. -Ken-
  1427.  
  1428. +++++++++++++++++++++++++++
  1429.  
  1430. >From Clay Thurmond <claytex@panix.com>
  1431. Date: 19 Sep 1994 04:45:00 GMT
  1432. Organization: TVMHS
  1433.  
  1434. In article <kenlongCwCzB5.Bsz@netcom.com> Ken Long, kenlong@netcom.com
  1435. writes:
  1436. >Kernighan on C - a big text (w.p.) document by Brian Kernigan on the C 
  1437. >language, SpInside Mac, and as much example source as could be found and 
  1438. >downloaded.  The books are all expensive and many only give you example 
  1439. >code and a book full of comments.  Some have useful info not found in 
  1440. >example code, but is it absolutely necessary for the price?
  1441.  
  1442. I've heard of this Spinside Mac a number of times, but I've never been
  1443. able to find it.  Archie comes up dry.  I haven't been able to locate it
  1444. on ftp.apple.com either.  Any idea where it is exactly?  Also, is this
  1445. Kernighan document available on the net?
  1446.  
  1447. Thanks,
  1448. Clay
  1449.  
  1450. +++++++++++++++++++++++++++
  1451.  
  1452. >From jwbaxter@olympus.net (John W. Baxter)
  1453. Date: Mon, 19 Sep 1994 12:05:37 -0700
  1454. Organization: Internet for the Olympic Peninsula
  1455.  
  1456. In article <35j50c$o1v@news.panix.com>, Clay Thurmond <claytex@panix.com> wrote:
  1457.  
  1458. > In article <kenlongCwCzB5.Bsz@netcom.com> Ken Long, kenlong@netcom.com
  1459. > writes:
  1460. > >Kernighan on C - a big text (w.p.) document by Brian Kernigan on the C 
  1461. > >language, SpInside Mac, and as much example source as could be found and 
  1462. > >downloaded.  The books are all expensive and many only give you example 
  1463. > >code and a book full of comments.  Some have useful info not found in 
  1464. > >example code, but is it absolutely necessary for the price?
  1465. > I've heard of this Spinside Mac a number of times, but I've never been
  1466. > able to find it.
  1467.  
  1468. SpInside Mac is a monster Hypercard stack (with bunches of supporting
  1469. files).  That in itself isn't so bad, but...SpInside Mac is also very
  1470. obsolete (roughly speaking, it is part way between volumes I through V and
  1471. volume VI, with some extras).
  1472.  
  1473. I've ignored it on the last couple of years of CDs it has come on, and
  1474. never looked for it on the net.  --John
  1475.  
  1476. -- 
  1477. John Baxter    Port Ludlow, WA, USA  [West shore, Puget Sound]
  1478.    "Occasionally...astronomers add a second to either June 31 or
  1479.     December 31..."   IM: OS Utilities, p 4-12
  1480.    jwbaxter@pt.olympus.net
  1481.  
  1482. +++++++++++++++++++++++++++
  1483.  
  1484. >From d_spacey@icrf.icnet.uk (Dylan the Hippy Wabbit)
  1485. Date: Wed, 21 Sep 1994 15:31:11 -0500
  1486. Organization: Imperial Cancer Research Fund
  1487.  
  1488. In article <35j50c$o1v@news.panix.com>, Clay Thurmond <claytex@panix.com>
  1489. wrote:
  1490.  
  1491.  
  1492. > I've heard of this Spinside Mac a number of times, but I've never been
  1493. > able to find it.  Archie comes up dry.  I haven't been able to locate it
  1494. > on ftp.apple.com either.  Any idea where it is exactly?  Also, is this
  1495. > Kernighan document available on the net?
  1496. > Thanks,
  1497. > Clay
  1498.  
  1499. Ftp to ftp.apple.com, I'm afraid I don't remember the directory name. 
  1500. Alternatively use http://dts.apple.com if you have a web browser.  Either
  1501. way be warned about the time/disk space requirements.  There are eight
  1502. parts taking up 7 1/2 meg.  Being multipart you will need unstuffit rather
  1503. than stuffit expander.
  1504.  
  1505. Once you've got it you'll find it's like learning a language from a
  1506. French/English dictionary.  I've been scratching my head over the thing all
  1507. year.
  1508.  
  1509. Dave Spacey
  1510.  
  1511. -- 
  1512. Don't underestimate the abacus......it requires no power, can be made with
  1513. any materials you have to hand, and never goes bing in the middle of an
  1514. important piece of work.   (Many thanks to Douglas Adams.)
  1515.  
  1516. +++++++++++++++++++++++++++
  1517.  
  1518. >From s.fraser@ic.ac.uk (Simon Fraser)
  1519. Date: Wed, 21 Sep 94 19:52:09 BST
  1520. Organization: Centre for Population Biology, Imperial College, UK.
  1521.  
  1522. In article <35j50c$o1v@news.panix.com> Clay Thurmond, claytex@panix.com
  1523. writes:
  1524. >I've heard of this Spinside Mac a number of times, but I've never been
  1525. >able to find it.  Archie comes up dry.  I haven't been able to locate it
  1526. >on ftp.apple.com either.  Any idea where it is exactly?  Also, is this
  1527.  
  1528. OK, here it is!
  1529.  
  1530. ftp.apple.com:dts/mac/docs/stacks/spinside/spinside-mac-4-0-2-pt1.hqx
  1531. ftp.apple.com:dts/mac/docs/stacks/spinside/spinside-mac-4-0-2-pt2.hqx
  1532. ftp.apple.com:dts/mac/docs/stacks/spinside/spinside-mac-4-0-2-pt3.hqx
  1533. ftp.apple.com:dts/mac/docs/stacks/spinside/spinside-mac-4-0-2-pt4.hqx
  1534. ftp.apple.com:dts/mac/docs/stacks/spinside/spinside-mac-4-0-2-pt5.hqx
  1535. ftp.apple.com:dts/mac/docs/stacks/spinside/spinside-mac-4-0-2-pt6.hqx
  1536. ftp.apple.com:dts/mac/docs/stacks/spinside/spinside-mac-4-0-2-pt7.hqx
  1537.  
  1538. The whole lot uncompresses into a 10.8Mb folder.
  1539. I find it really useful (well, more so before I started to buy the
  1540. new Inside Macintosh books (you'll see them referred to as NIM: Text
  1541. for example).
  1542. Stretching out the Hypercard stack to the height of a 14" monitor
  1543. makes it a lot easier as well. I did this by a combination of
  1544. 'set the userlevel to 5' in the message box, and having a new, 
  1545. unprotected stack open at the same time, which enabled me to get
  1546. at the tool palette.
  1547.  
  1548. You might also find the technotes stack useful-- 5.9 Mb worth!
  1549.  
  1550. ftp.apple.com:dts/mac/docs/stacks/tnstack/tech-notes-stack-4-0-4-pt1.hqx
  1551. ftp.apple.com:dts/mac/docs/stacks/tnstack/tech-notes-stack-4-0-4-pt2.hqx
  1552. ftp.apple.com:dts/mac/docs/stacks/tnstack/tech-notes-stack-4-0-4-pt3.hqx
  1553. ftp.apple.com:dts/mac/docs/stacks/tnstack/tech-notes-stack-4-0-4-pt4.hqx
  1554. ftp.apple.com:dts/mac/docs/stacks/tnstack/tech-notes-stack-4-0-4-pt5.hqx
  1555.  
  1556. Hope this helps!
  1557.  
  1558. Simon
  1559. P.S. the best time to access files of this size of off-peak at a weekend.
  1560. It's dead fast early on a Sunday morning from the UK!
  1561. __________________________________________________________________________
  1562. Simon Fraser                            NERC Centre for Population Biology
  1563. s.fraser@ic.ac.uk                         Imperial College at Silwood Park
  1564.                                              Ascot, Berkshire, SL5 7PY. UK
  1565.  
  1566. ---------------------------
  1567.  
  1568. >From beltoft@icaen.uiowa.edu (Brian S Eltoft)
  1569. Subject: Help: idle, shutdown, and MacTCP examples..
  1570. Date: 19 Sep 1994 13:31:21 GMT
  1571. Organization: Iowa Computer Aided Engineering Network
  1572.  
  1573.  
  1574. I'm looking for source code that shows how you would write a program to 
  1575. sense that the mac has been idle for sometime... as well as an example 
  1576. of a safe shutdown (as if I'm using the shutdown from the special menu).
  1577. I tried the example found in Inside Mac, but it gives me an error of 
  1578. -609 when I try the AESend(..)  I was also looking about for some examples
  1579. of MacTCP...  something that would do a finger...
  1580.  
  1581. If anyone has any info on where to look for this code could you please mail
  1582. it to: beltoft@icaen.uiowa.edu
  1583.  
  1584. -- 
  1585. Brian Eltoft   
  1586. Email:  beltoft@icaen.uiowa.edu
  1587.  
  1588. +++++++++++++++++++++++++++
  1589.  
  1590. >From brook@psy.uwa.edu.au (Brook )
  1591. Date: 19 Sep 1994 23:28:43 GMT
  1592. Organization: The University of Western Australia
  1593.  
  1594. beltoft@icaen.uiowa.edu (Brian S Eltoft) writes:
  1595.  
  1596.  
  1597. >I'm looking for source code that shows how you would write a program to 
  1598. >sense that the mac has been idle for sometime... as well as an example 
  1599. >of a safe shutdown (as if I'm using the shutdown from the special menu).
  1600. >I tried the example found in Inside Mac, but it gives me an error of 
  1601. >-609 when I try the AESend(..)  I was also looking about for some examples
  1602. >of MacTCP...  something that would do a finger...
  1603.  
  1604.  The following function is a correction to the one shown in IM:Processes
  1605. and works for me.                             
  1606. FUNCTION ShutDownSafely : OSErr
  1607. CONST
  1608.     kFinderSig = 'MACS'
  1609. VAR
  1610.     myErr:        OSErr;
  1611.     finderAddr:    AEDesc;
  1612.     myShutDown:    AppleEvent;
  1613.     nilReply:        AppleEvent;
  1614.     signature:    OSType;
  1615. BEGIN
  1616.     signature := kFinderSig;
  1617.     myErr := AECreateDesc ( typeApplSignature,
  1618.                             @signature,SizeOf(OSType),
  1619.                             finderAddr);
  1620.     IF myErr = noErr THEN
  1621.         myErr := AECreateAppleEvent ( kAEFinderEvents,
  1622.                     kAEShutDown,finderAddr,
  1623.                     kAutoGenerateReturnID,
  1624.                     AnyTransactionID,myShutDown);
  1625.     IF myErr = noErr THEN
  1626.         myErr := AESend ( myShutDown,nilReply,
  1627.                     kAENoreply + kAECanSwitchLayer
  1628.                     + kAEAlwaysInteract,
  1629.                     kAENormalPriority,
  1630.                     kAEDefaultTimeOut,nil,nil);
  1631.     ShutDownSafely := myErr;
  1632. END;
  1633.  
  1634. --
  1635. Brooklyn Waters (Senior Programmer)    email: brook@psy.uwa.edu.au
  1636. Centre for Computer Managed Training and Decision Support Systems
  1637. The University of Western Australia    Tel: +61-9-3803637
  1638. NEDLANDS WA 6009   AUSTRALIA           FAX: +61-9-3801006
  1639.  
  1640. +++++++++++++++++++++++++++
  1641.  
  1642. >From David_Seale@magic.ca (David Seale)
  1643. Date: 21 Sep 1994 22:08:32 GMT
  1644. Organization: Magic Online Services Toronto Inc.
  1645.  
  1646. "I'm looking for source code that shows how you would write a program to 
  1647. sense that the mac has been idle for sometime... as well as an example 
  1648. of a safe shutdown (as if I'm using the shutdown from the special menu).
  1649. I tried the example found in Inside Mac, but it gives me an error of 
  1650. -609 when I try the AESend(..)"
  1651.  
  1652. I seem to remember that the -609 error is because the example in IM:Processes
  1653. is wrong.
  1654. I think that the solution is to change the Finder signature to 'MACS',
  1655. instead of 'FNDR' or whatever they have.
  1656. If that doesn't work, use the process manager to look for the Finder, and
  1657. then use the ProcessSerialNumber version of the AE (That's what I did).
  1658.  
  1659. The idle thing is not as hard as it sounds. I used a timer task to check to
  1660. see if any of the keys were down on the keyboard (using GetKeys), and if the
  1661. mouse was still in the same position, works very well.
  1662.  
  1663. Hope this is helpful (and that I'm not confused again).
  1664.  
  1665. Dave.
  1666. david_seale@magic.ca
  1667.  
  1668.  
  1669. ---------------------------
  1670.  
  1671. >From fehrst@herald.usask.ca (Stuart Fehr)
  1672. Subject: Pascal Flavours for Macintosh
  1673. Date: 19 Sep 1994 19:16:07 GMT
  1674. Organization: University of Saskatchewan
  1675.  
  1676. Our campus bookstore sells two Pascal for Macintosh software packages.  
  1677. They are:  Think Pascal by Symantec, and Pascal for the Macintosh, also 
  1678. by Symantec.
  1679.  
  1680. What are the differences?  Or, maybe I should ask, what is Pascal for the 
  1681. Macintosh?  I haven't read or heard anything about it at all.  I have 
  1682. been reading the posts on Think Pascal, but have seen no mention of this 
  1683. other one.
  1684.  
  1685. There is a significant price difference too -- Pascal for the Macintosh 
  1686. is approx. $20.00 more than think Pascal.
  1687.  
  1688. Any suggestions or information would be appreciated.
  1689.  
  1690. +++++++++++++++++++++++++++
  1691.  
  1692. >From peter.lewis@info.curtin.edu.au (Peter N Lewis)
  1693. Date: Wed, 21 Sep 1994 10:40:25 +0800
  1694. Organization: NCRPDA, Curtin University
  1695.  
  1696. In article <35ko1n$5b8@tribune.usask.ca>, fehrst@herald.usask.ca (Stuart
  1697. Fehr) wrote:
  1698.  
  1699. >Our campus bookstore sells two Pascal for Macintosh software packages.  
  1700. >They are:  Think Pascal by Symantec, and Pascal for the Macintosh, also 
  1701. >by Symantec.
  1702.  
  1703. No idea.  Symantec used to (and may still do) sell a Juse Enough Pascal
  1704. which was a education tool or something, I'm not sure.
  1705.  
  1706. Pascal Compilers:
  1707.  
  1708. THINK Pascal 4.0.2
  1709. Object Pascal.  68k only.  Very nice environment.  Basically bug free, but
  1710. the program is dead (it will likely never be updated) and is growing
  1711. incompatiblities with each new system version.
  1712.  
  1713. Metrowerks CodeWarrior Pascal
  1714. No Objects (scheduled for the end of the year).  Native & 68k, both are
  1715. still in development and are not bug free.  Quite nice environment, also
  1716. still in development.  Not quite production quality as yet, but this
  1717. program is getting being worked on full time by Metrowerks, and will
  1718. almost certainly be the Pascal compiler to choose after the end of the
  1719. year.
  1720.  
  1721. Language Systems Pascal
  1722. Object Pascal.  Native (& 68k?).  Still in beta, I dont know how solid it
  1723. is.  MPW evironment only, so not really suitable for education/lab use if
  1724. you want a friendly environment.
  1725.  
  1726. MPW Pascal
  1727. Object Pascal.  68K only.  Free from serious bugs.  Doesn't cut it for a
  1728. standalone project when compared to Think Pascal but useful when you need
  1729. to build something strange (INITs, DRVRs, etc).
  1730.  
  1731. Enjoy,
  1732.    Peter.
  1733. -- 
  1734. Peter N Lewis <peter.lewis@info.curtin.edu.au> - Macintosh TCP fingerpainter
  1735. FTP my programs from redback.cs.uwa.edu.au:Others/PeterLewis/ or
  1736. amug.org:pub/peterlewis/ or nic.switch.ch:software/mac/peterlewis/
  1737.  
  1738. ---------------------------
  1739.  
  1740. >From bb@lightside.com (Bob Bradley)
  1741. Subject: Q: Script-Independant Command-Keys?
  1742. Date: Sun, 18 Sep 1994 10:54:40 -0800
  1743. Organization: SS Software Inc.
  1744.  
  1745. I have a simple dialog for "Don't Save, "Cancel", "Save" and want to
  1746. handle commands keys for the dialog correctly. Right now, I'm just
  1747. checking for 'D', Escape or Command Period (I am doing international
  1748. canceling), and Return or Enter, respectively but, I know there's a better
  1749. way.
  1750.  
  1751. I'd like to make the code localizable and to also get rid of data (the raw
  1752. 'D' letter, etc..) from the source code (so I don't have t re-compile to
  1753. change it).
  1754.  
  1755. How would I go about this? I assume it would all be thru the use of the
  1756. Script Manager but, I'm not sure on the implementation.
  1757.  
  1758. +++++++++++++++++++++++++++
  1759.  
  1760. >From resnick@uiuc.edu (Pete Resnick)
  1761. Date: Mon, 19 Sep 1994 23:38:05 -0500
  1762. Organization: University of Illinois at Urbana-Champaign
  1763.  
  1764. In article <bb-1809941054400001@user53.lightside.com>, bb@lightside.com
  1765. (Bob Bradley) wrote:
  1766.  
  1767. > I have a simple dialog for "Don't Save, "Cancel", "Save" and want to
  1768. > handle commands keys for the dialog correctly. Right now, I'm just
  1769. > checking for 'D', Escape or Command Period (I am doing international
  1770. > canceling), and Return or Enter, respectively but, I know there's a better
  1771. > way.
  1772. > I'd like to make the code localizable and to also get rid of data (the raw
  1773. > 'D' letter, etc..) from the source code (so I don't have t re-compile to
  1774. > change it).
  1775. > How would I go about this? I assume it would all be thru the use of the
  1776. > Script Manager but, I'm not sure on the implementation.
  1777.  
  1778. For single-byte languages, this is easy: Just do a GetControlTitle() for
  1779. each of the controls in the dialog (doing a GetDialogItem() to get the
  1780. control handles) and then compare the keystroke with the first character
  1781. of the control title. Use the same method you do for command-period to
  1782. make sure that you get the correct ASCII character code, and then make
  1783. sure to use the CompareText() or IdenticalText() routines so that case and
  1784. diacriticals are handled properly.
  1785.  
  1786. For double-byte languages, you're going to have a problem since the
  1787. character codes for a single character are going to come through in two
  1788. events. In this case, you could get really cute and force the keyboard to
  1789. something that will produce single-bytes only (like Romanji in Japanese)
  1790. and then Transliterate() the names of the buttons and compare the first
  1791. character, but I think this gets a little absurd. Personally, if the
  1792. current font for the buttons (i.e. the system font or the window font of
  1793. your dialog if the buttons are useWFont) is a double-byte character font,
  1794. I would punt on the "command key for the first letter of the button"
  1795. method.
  1796.  
  1797. pr
  1798. -- 
  1799. Pete Resnick    (...so what is a mojo, and why would one be rising?)
  1800. Doctoral Student - Philosophy Department, Gregory Hall, UIUC
  1801. System manager - Cognitive Science Group, Beckman Institute, UIUC
  1802. Internet: resnick@uiuc.edu
  1803.  
  1804. +++++++++++++++++++++++++++
  1805.  
  1806. >From bb@lightside.com (Bob Bradley)
  1807. Date: Sun, 18 Sep 1994 14:19:30 -0800
  1808. Organization: SS Software Inc.
  1809.  
  1810. In article <resnick-1909942338050001@resnick1.isdn.uiuc.edu>,
  1811. resnick@uiuc.edu (Pete Resnick) wrote:
  1812.  
  1813. > For single-byte languages, this is easy: Just do a GetControlTitle() for
  1814. > each of the controls in the dialog (doing a GetDialogItem() to get the
  1815. > control handles) and then compare the keystroke with the first character
  1816. > of the control title. Use the same method you do for command-period to
  1817. > make sure that you get the correct ASCII character code, and then make
  1818. > sure to use the CompareText() or IdenticalText() routines so that case and
  1819. > diacriticals are handled properly.
  1820. > For double-byte languages, you're going to have a problem since the
  1821. > character codes for a single character are going to come through in two
  1822. > events. In this case, you could get really cute and force the keyboard to
  1823. > something that will produce single-bytes only (like Romanji in Japanese)
  1824. > and then Transliterate() the names of the buttons and compare the first
  1825. > character, but I think this gets a little absurd. Personally, if the
  1826. > current font for the buttons (i.e. the system font or the window font of
  1827. > your dialog if the buttons are useWFont) is a double-byte character font,
  1828. > I would punt on the "command key for the first letter of the button"
  1829. > method.
  1830.  
  1831. I'd like to figure out a good method for storing the command-keys in a
  1832. resource which I could pull out later since a few of the button
  1833. command-keys I want to use are not the same as the first letter of the
  1834. button (ie. Add is usually command-G).
  1835.  
  1836. Is there anyway to tell if, when a double-byte script is installed the
  1837. user types the first half of a double-byte character? If so, I could
  1838. detect this, store the first half and if the second half comes thru in the
  1839. next event, do my compare as I would with a regular key.
  1840.  
  1841. I'd like to store the command-keys as a string resource with each key as
  1842. an individual string with the string id (index if in a STR# resource)
  1843. relating the particular button. Could I just compare the key entered with
  1844. the key stored in the string to see if they are equal or would I have to
  1845. use a special Script Manager comparison routine?
  1846.  
  1847. +++++++++++++++++++++++++++
  1848.  
  1849. >From ari@world.std.com (Ari I Halberstadt)
  1850. Date: Wed, 21 Sep 1994 04:19:44 GMT
  1851. Organization: The World Public Access UNIX, Brookline, MA
  1852.  
  1853. In article <resnick-1909942338050001@resnick1.isdn.uiuc.edu>,
  1854. Pete Resnick <resnick@uiuc.edu> wrote:
  1855. >In article <bb-1809941054400001@user53.lightside.com>, bb@lightside.com
  1856. >(Bob Bradley) wrote:
  1857. >
  1858. >> I have a simple dialog for "Don't Save, "Cancel", "Save" and want to
  1859. >> handle commands keys for the dialog correctly. Right now, I'm just
  1860. >> checking for 'D', Escape or Command Period (I am doing international
  1861. >> canceling), and Return or Enter, respectively but, I know there's a better
  1862. >> way.
  1863. >>...
  1864. >For single-byte languages, this is easy: Just do a GetControlTitle() for
  1865. >each of the controls in the dialog (doing a GetDialogItem() to get the
  1866. >control handles) and then compare the keystroke with the first character
  1867. >of the control title. Use the same method you do for command-period to
  1868. >make sure that you get the correct ASCII character code, and then make
  1869. >sure to use the CompareText() or IdenticalText() routines so that case and
  1870. >diacriticals are handled properly.
  1871.  
  1872. A resource that defines equivalence between buttons and command keys.
  1873. Use some special resource type, say "CMDK" or "DLCK" (dialog command
  1874. key), or whatever, and give it the same ID as the dialog or alert. Or
  1875. a <clover><char> syntax you tack onto the end of the button names,
  1876. then extract before displaying the dialog or alert. Other languages
  1877. might not have unique first-character button names, and you might not
  1878. want command key equivalence for some buttons, etc. so storing it in
  1879. the resource data is more flexible.
  1880. -- 
  1881. Ari Halberstadt                                 ari@world.std.com
  1882. One generation passes away, and another generation comes: but the
  1883. earth abides for ever. -- Ecclesiastes, 1:4.
  1884.  
  1885. +++++++++++++++++++++++++++
  1886.  
  1887. >From lalonde@metrowerks.ca (Paul Lalonde)
  1888. Date: Thu, 22 Sep 1994 23:46:20 GMT
  1889. Organization: Metrowerks
  1890.  
  1891. In article <bb-1809941054400001@user53.lightside.com>, bb@lightside.com
  1892. (Bob Bradley) wrote:
  1893.  
  1894. > I have a simple dialog for "Don't Save, "Cancel", "Save" and want to
  1895. > handle commands keys for the dialog correctly. Right now, I'm just
  1896. > checking for 'D', Escape or Command Period (I am doing international
  1897. > canceling), and Return or Enter, respectively but, I know there's a better
  1898. > way.
  1899. > I'd like to make the code localizable and to also get rid of data (the raw
  1900. > 'D' letter, etc..) from the source code (so I don't have t re-compile to
  1901. > change it).
  1902. > How would I go about this? I assume it would all be thru the use of the
  1903. > Script Manager but, I'm not sure on the implementation.
  1904.  
  1905. You would basically need a modal dialog filter proc in which, every time 
  1906. a key down was received with the command key down, you loop through all of 
  1907. the items in the dialog's item list.  If an item is a button, you retrieve 
  1908. its title and compare the first character with the character just pressed.
  1909.  
  1910. Of course, if you also want to deal with double-byte systems, you need to 
  1911. store state information between calls to the filter proc so you will know 
  1912. if a key corresponds to the first or second byte of a character.
  1913.  
  1914. Paul Lalonde
  1915. lalonde@metrowerks.ca
  1916.  
  1917. +++++++++++++++++++++++++++
  1918.  
  1919. >From bb@lightside.com (Bob Bradley)
  1920. Date: Wed, 21 Sep 1994 16:21:17 -0800
  1921. Organization: SS Software Inc.
  1922.  
  1923. In article <lalonde-2209941946200001@slip68.dialup.mcgill.ca>,
  1924. lalonde@metrowerks.ca (Paul Lalonde) wrote:
  1925.  
  1926. > You would basically need a modal dialog filter proc in which, every time 
  1927. > a key down was received with the command key down, you loop through all of 
  1928. > the items in the dialog's item list.  If an item is a button, you retrieve 
  1929. > its title and compare the first character with the character just pressed.
  1930. > Of course, if you also want to deal with double-byte systems, you need to 
  1931. > store state information between calls to the filter proc so you will know 
  1932. > if a key corresponds to the first or second byte of a character.
  1933.  
  1934. The way I'm doing it now is to create a key item command table when the
  1935. dialog is create based on a custom resource that contains the key (just a
  1936. 2 byte short), the item it goes with, and which modifiers are required
  1937. (ie. command, option, control) then when I get a key down, in my proc to
  1938. handle key downs in dialogs (they are all modeless) I search the table for
  1939. the typed key and check whether or not the correct modifiers were down
  1940. when it was pressed (I also use the method in the Tech Note International
  1941. Canceling to work with keyboards that discharge the shift key when the
  1942. command key is down). I also made a simple Resorcerer template for
  1943. creating and editing the key item command table
  1944.  
  1945. It seems to work ok but, I haven't tested it with any non-roman scripts.
  1946.  
  1947. ---------------------------
  1948.  
  1949. >From gpointer@guest.adelaide.edu.au (Geoff Pointer)
  1950. Subject: XCMD memory residence
  1951. Date: 19 Sep 1994 10:50:46 GMT
  1952. Organization: Individual
  1953.  
  1954.    I am trying to manage an external window for Hypercard. It is geared
  1955. to handle several windows open at once and I have handled the fact that
  1956. all windows will be using the same copy of the XCMD code. What I am not
  1957. clear about, is what can happen to the code resource in between event
  1958. calls. I am aware that it can be moved in memory but can it ever be
  1959. purged? I am presently basing my logic on the code not being purged and
  1960. being copied from its original location in memory when it is moved rather
  1961. than recopied from the original resource. Is it possible to get definitive
  1962. answers??
  1963.    My problem involves how I use certain globals (via A4, I use Code
  1964. Warrior). I use RefCon stuff for the globals that go with each individual
  1965. window, but I need special action for the first window open and the last
  1966. window closed, which involves retaining knowledge across individual event
  1967. calls.
  1968.  
  1969. - --------- Cheers - Geoff %^> ----------
  1970.  
  1971.   Voice: 61 8 362 9890     63 Lambert Rd
  1972.   Fax:   61 8 363 2682     Joslin SA 5070
  1973.                            Australia
  1974.  
  1975. - ---------------------------------------
  1976.  
  1977.  
  1978. +++++++++++++++++++++++++++
  1979.  
  1980. >From e-baumgartner@nwu.edu (Eric Baumgartner)
  1981. Date: Mon, 19 Sep 1994 16:27:53 -0500
  1982. Organization: Northwestern University
  1983.  
  1984. In article <35jqe6$qgt@quandong.itd.adelaide.edu.au>,
  1985. gpointer@guest.adelaide.edu.au (Geoff Pointer) wrote:
  1986.  
  1987. > all windows will be using the same copy of the XCMD code. What I am not
  1988. > clear about, is what can happen to the code resource in between event
  1989. > calls. I am aware that it can be moved in memory but can it ever be
  1990. > purged?
  1991.  
  1992. >    My problem involves how I use certain globals (via A4, I use Code
  1993. > Warrior). I use RefCon stuff for the globals that go with each individual
  1994. > window, but I need special action for the first window open and the last
  1995. > window closed, which involves retaining knowledge across individual event
  1996. > calls.
  1997.  
  1998. Yes, your xcmd can be purged in between event calls. If you want to use
  1999. "global globals" I know of two options:
  2000.  
  2001. 1. Tell HC that you have interrupt code by calling XWHasInterruptCode.
  2002. Evil, evil, evil, but it'll keep your code resource resident and locked.
  2003. 2. Use a HC global to store your globals. You could store the address of a
  2004. handle containing the globals, or you could store the globals themselves
  2005. in text form in the HC variable.
  2006.  
  2007. I'd be curious to hear if anyone has any other suggestions.
  2008.  
  2009. Eric Baumgartner                       *   Email: e-baumgartner@nwu.edu
  2010. Learning Sciences                      *   Phone: 708/467-2816
  2011. School of Education and Social Policy  *
  2012. Northwestern University                *
  2013.  
  2014. +++++++++++++++++++++++++++
  2015.  
  2016. >From ari@world.std.com (Ari I Halberstadt)
  2017. Date: Tue, 20 Sep 1994 01:01:20 GMT
  2018. Organization: The World Public Access UNIX, Brookline, MA
  2019.  
  2020. In article <35jqe6$qgt@quandong.itd.adelaide.edu.au>,
  2021. Geoff Pointer <gpointer@guest.adelaide.edu.au> wrote:
  2022. >   I am trying to manage an external window for Hypercard. It is geared
  2023. >to handle several windows open at once and I have handled the fact that
  2024. >all windows will be using the same copy of the XCMD code. What I am not
  2025. >clear about, is what can happen to the code resource in between event
  2026. >calls. I am aware that it can be moved in memory but can it ever be
  2027. >purged? I am presently basing my logic on the code not being purged and
  2028. >being copied from its original location in memory when it is moved rather
  2029. >than recopied from the original resource. Is it possible to get definitive
  2030. >answers??
  2031. >   My problem involves how I use certain globals (via A4, I use Code
  2032. >Warrior). I use RefCon stuff for the globals that go with each individual
  2033. >window, but I need special action for the first window open and the last
  2034. >window closed, which involves retaining knowledge across individual event
  2035. >calls.
  2036. >
  2037.  
  2038. You can mark the XCMD resource as non-purgeable. But that still
  2039. doesn't prevent HyperCard, or anyone else, from explicitely purging
  2040. it. Better to set a HyperCard global variable from within your XCMD.
  2041. There are a couple of call-backs for setting and retrieving a global
  2042. variable's value. When your XCMD exits, it sets the value of the
  2043. global to a handle to some structure containing the state information.
  2044. When the last window is disposed of, you clear the global (set it to
  2045. the empty string). You should give the global some unlikely name. For
  2046. instance, if the XCMD is called "MyXCMD", I'd call the global
  2047. "gMyXCMD". The "g" is just that Apple pseudo-standard for global
  2048. variables, and the "MyXCMD" part makes it clear to anyone looking at
  2049. the global in the debugger that it's part of your XCMD, and also
  2050. reduces the chance that someone will use the same name for their own
  2051. global variable.
  2052. -- 
  2053. Ari Halberstadt                                 ari@world.std.com
  2054. One generation passes away, and another generation comes: but the
  2055. earth abides for ever. -- Ecclesiastes, 1:4.
  2056.  
  2057. +++++++++++++++++++++++++++
  2058.  
  2059. >From jkc@apple.com (John Kevin Calhoun)
  2060. Date: 22 Sep 1994 16:45:21 -0700
  2061. Organization: Apple Computer Inc, Cupertino, CA
  2062.  
  2063.  
  2064. In article <35jqe6$qgt@quandong.itd.adelaide.edu.au>,
  2065. Geoff Pointer <gpointer@guest.adelaide.edu.au> wrote:
  2066. >   I am trying to manage an external window for Hypercard. It is geared
  2067. >to handle several windows open at once and I have handled the fact that
  2068. >all windows will be using the same copy of the XCMD code. What I am not
  2069. >clear about, is what can happen to the code resource in between event
  2070. >calls. I am aware that it can be moved in memory but can it ever be
  2071. >purged? I am presently basing my logic on the code not being purged and
  2072. >being copied from its original location in memory when it is moved rather
  2073. >than recopied from the original resource. Is it possible to get definitive
  2074. >answers??
  2075.  
  2076. It's not possible to prevent an XCMD or XFCN resource from being purged
  2077. unless you also prevent it from being moved.  You can do this with
  2078. the callback XWHasInterruptCode, which, in effect, locks the resource
  2079. in memory.  However, leaving something locked in an unpredictable
  2080. location in HyperCard's heap is a very unfriendly thing to do, unless
  2081. it's absolutely necessary.
  2082.  
  2083. Furthermore, Apple does not guarantee that HyperCard's handling of
  2084. XCMD and XFCN resources will remain the same with each release of
  2085. HyperCard; in fact, it changed between 1.x and 2.x and might change
  2086. again.  Therefore I think it's not wise to rely on the way HyperCard
  2087. currently executes external code.
  2088.  
  2089. >   My problem involves how I use certain globals (via A4, I use Code
  2090. >Warrior). I use RefCon stuff for the globals that go with each individual
  2091. >window, but I need special action for the first window open and the last
  2092. >window closed, which involves retaining knowledge across individual event
  2093. >calls.
  2094.  
  2095. Instead of relying on A4 globals, you can store and update a count
  2096. of your windows in a HyperTalk global, which you can access via the
  2097. SetGlobal and GetGlobal callbacks.
  2098.  
  2099. With HyperCard 2.2, it's possible to count your windows on the fly,
  2100. as follows:
  2101.  
  2102.   function countWindowsOf externalName
  2103.     put 0 into count
  2104.     repeat with thisWindow = 1 to the number of windows
  2105.       if the owner of window thisWindow is externalName
  2106.       then add 1 to count
  2107.     end repeat
  2108.     return count
  2109.   end countWindowsOf
  2110.  
  2111. >From an external you could execute similar HyperTalk code by
  2112. using the RunHandler callback.
  2113.  
  2114. Kevin Calhoun
  2115. jkc@apple.com
  2116.  
  2117. ---------------------------
  2118.  
  2119. End of C.S.M.P. Digest
  2120. **********************
  2121.  
  2122.  
  2123. ˇ